package com.donleo.cn.annotation.dao;

import com.donleo.cn.annotation.Delete;
import com.donleo.cn.annotation.Insert;
import com.donleo.cn.annotation.Select;
import com.donleo.cn.annotation.Update;

import java.util.List;

/**
 * @author liangd
 * date 2020-11-17 11:17
 * code 使用自定义注解定义sql语句
 */
public interface UserMapper {
    @Insert("insert into user(id,username,age,phone,email) values(?,?,?,?,?)")
    void add(Integer id, String username, Integer age, String phone, String email);

    @Delete("delete from user where id = ?")
    void delete(Integer id);

    @Update("update user set username=?,age=?,phone=?,email=? where id=?")
    void update(String username,Integer age,String phone,String email,Integer id);

    @Select("select * from user")
    void select();
}
